package dq.study.jmx;

import javax.management.Notification;
import javax.management.NotificationBroadcasterSupport;

/**
 * @author dongqun
 * @date 2020/3/26 14:30
 */
public class Tom  extends NotificationBroadcasterSupport implements TomMBean{
    private int seq = 0;
    @Override
    public void sayHi() {
        //创建一个信息包
        Notification notify =
                //通知名称；谁发起的通知；序列号；发起通知时间；发送的消息
                new Notification("tom.hi",this,++seq,System.currentTimeMillis(),"tom");
        sendNotification(notify);
    }
}
